import type { FC } from 'react';
import React from 'react';
import t from 'prop-types';

import type { KindMap } from './interface';
import type { AlertProps } from './interface';

const prefixCls = 'white-alert';

const kinds: KindMap = {
  info: '#5353ED',
  positive: '#2ED573',
  negative: '#FF4757',
  warning: '#FFA502',
}

const Alert: FC<AlertProps> = ({ children, kind = 'info', ...reset }) => (
  <div
    className={prefixCls}
    style={{ background: kinds[kind] }}
    {...reset}
  >
    {children}
  </div>
)

Alert.propTypes = {
  kind: t.oneOf(['info', 'positive', 'negative', 'warning']),
}

export default Alert;